package utils;

import java.rmi.RemoteException;

import client.Callback_deprecated;

public class RmiWrapper_deprecated {

	private client.Callback_deprecated client;

	public RmiWrapper_deprecated() {
		// RMI handling:start
		client = new Callback_deprecated();
		// RMI handling:end
	}

	// GETTERS & SETTERS start
	private client.Callback_deprecated getClient() {
		return client;
	}

	private void setClient(client.Callback_deprecated client) {
		this.client = client;
	}
	// GETTERS & SETTERS end
	
	public boolean lockCell(int abscissa, int ordinate) {
		try {
			Callback_deprecated c = this.getClient();
			server.ICallbackHandler proxy = c.getProxy();
			boolean success = proxy.lockCell(abscissa, ordinate, java.util.UUID.randomUUID());
			return success;
		} catch (RemoteException e) {
			System.out.println("An exception was throwned @RmiWrapper.lockCell");
			//TODO tratar excepcao
			return false;
		}
	}
}
